import React from 'react';
import { Layout } from 'antd';
import LabelList from '@/pages/robotManagement/hotQuestion/labelList';
import QuestionList from '@/pages/robotManagement/hotQuestion/questionList';

const { Header, Content, Footer, Sider } = Layout;

class HotQuestion extends React.Component {
  getCurrentLabelInfo = info => {
    this.QuestionList.getQuestionsBuCurrentLabel(info);
  };
  refreshQuestion = () => {
    this.QuestionList.refreshQuestionList();
  };
  render() {
    return (
      <Layout style={{ padding: '24px 0', background: '#fff' }}>
        <Sider width={200} style={{ background: '#fff' }}>
          <LabelList
            getCurrentLabelInfo={this.getCurrentLabelInfo}
            robotId={this.props.robotId}
            refreshQuestion={this.refreshQuestion}
          />
        </Sider>
        <Content style={{ padding: '0 24px', minHeight: 280 }}>
          <QuestionList onRef={ref => (this.QuestionList = ref)} robotId={this.props.robotId} />
        </Content>
      </Layout>
    );
  }
}

export default HotQuestion;
